package com.icarsaas.saas.tenant.system.model;

import com.icarsaas.saas.common.utils.HttpServletUtil;
import com.icarsaas.saas.component.base.DataEntity;
import lombok.Data;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.util.StringUtils;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.*;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;

/**
 * 消息实体
 */
@EntityListeners(AuditingEntityListener.class)
@Data @Entity @Table(name = "sys_message")
@DynamicInsert @DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@org.hibernate.annotations.Table(appliesTo = "sys_message",comment="消息实体表")
public class Message extends DataEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	@Column(name = "id", nullable = false, insertable = true, updatable = true, length = 36)
	private String id;
	@Column(columnDefinition="varchar(500) COMMENT '标题'")
	private String title;
	@Column(columnDefinition="varchar(50) COMMENT '消息所属模块'")
	private String module;
	@Column(columnDefinition="varchar(50) COMMENT '消息类别:0-业务待办；1-通知'")
	private String type;
	@Column(columnDefinition="varchar(255) COMMENT '消息跳转路径'")
	private String url;
	@Column(columnDefinition="varchar(255) COMMENT '消息关联主表id,多个通过逗号分隔'")
	private String refId;
	@Column(columnDefinition="varchar(256) COMMENT '显示消息'")
	private String message;
	@Column(columnDefinition="varchar(256) COMMENT '消息状态'")
	private String status;

}
